{% load static %}

{#{% for adv in adv_obj %}#}
{% for adv in adv_list %}
    <div class="adv_block" style="margin-bottom: 30px">
        <div class="pull-right" style="fill: none">
            <a class="btn_close_adv"><span class="glyphicon glyphicon-remove"></span></a>
        </div>
        <div class="thumbnail">
            <img src="/media/{{ adv.img }}/" alt="" style="height: 300px;width: 200px">
            <div class="caption">
                <h3>{{ adv.title }}</h3>
                <p>{{ adv.content|truncatechars:10 }}...</p>  <!-- 正常英文时区下使用truncate省略部分可以自动显示...，中文时区无法显示，所以手动加 -->
                <p><a href="#" class="btn btn-danger" role="button">查看详细</a>
            </div>
        </div>
    </div>
{% endfor %}

<script>
    $('.btn_close_adv').click(function () {
        $(this).closest('.adv_block').hide()
    })
</script>